package com.huawei.crm.job.quartz;

import org.quartz.*;
import org.springframework.stereotype.Component;

@Component
public class HelloJobDetailConfig {

//    @Bean
    public JobDetail helloJobDetail() {
        JobDetail jobDetail = JobBuilder.newJob(HelloJob.class)
                .withIdentity("helloJob")
                .storeDurably()
                .usingJobData("data", "保密信息")
                .build();
        return jobDetail;
    }

//    @Bean
    public Trigger helloJobTrigger() {
        Trigger trigger = TriggerBuilder.newTrigger()
                .forJob("helloJob")
                .withSchedule(CronScheduleBuilder.cronSchedule("0/10 * * * * ? "))
                .build();

        return trigger;
    }
}
